public class nyuver {
    public static void main(String[] args) {
        int[] nums = new int[10];
        int n = nums.length;
        for (int i = 0; i < n; i++) {
            if(nums[i]>0){
                break;
            }
            int left = i+1,right = n-1,target = -nums[i];
            while (left<right){
                int sum = nums[left] + nums[right];
                if(sum>target)right--;
                else if(sum<target)left++;
                else{
                    left++;right--;
                    while (left<right && nums[left] == nums[left - 1]) left++;
                    while (left<right && nums[right] == nums[right + 1]) right--;
                }
            }
            i++;
            while (i<n && nums[i]==nums[i-1]) i++;
        }
    }
}
